#include "LocalScene.h"
#include "Utils/LogUtil.h"
#include "LocalEntity.h"
#include "Utils/StringUtil.h"
#include "Game/Component/Model.h"
#include "Render/RenderState.h"
#include "Render/Imgui/imgui.h"


void LocalScene::OnInit()
{
	LOGI(L"GameScene Init");


	GeometryGenerator geometryGenerator;
	// GeometryGenerator::MeshData sphereData = geometryGenerator.CreateSphere(0.1f, 10, 10);
	// GeometryGenerator::MeshData cylinderData = geometryGenerator.CreateCylinder(0.1f, 0.03f, 0.4f, 10, 10);
	// GeometryGenerator::MeshData panelData = geometryGenerator.CreateGrid(10.f, 10.f, 10, 10);
	GeometryGenerator::MeshData panelData = geometryGenerator.CreatePanel(3.f, 3.f, glm::vec3(0.f, 1.f, 0.f));

	LocalEntity* left = CreateEntity<LocalEntity>("Left");
	left->AddComponent<Model>(panelData);

	LocalEntity* right = CreateEntity<LocalEntity>("Right");
	right->AddComponent<Model>(panelData);

	mShaderNames.push_back("EdgeDetect");
	mShaderNames.push_back("Emboss");
	mShaderNames.push_back("Sharpen");

	mComputeProcess = GetProcess<ComputeProcess>("ComputeProcess");
}

void LocalScene::OnExit()
{

}

void LocalScene::OnTick(float deltaTime)
{

}

void LocalScene::OnImgui()
{
	GameScene::OnImgui();

	// ImGui::SetNextWindowPos(ImVec2(20, 20), ImGuiCond_FirstUseEver);

	ImGui::Begin("ComputeTexture");

	if (ImGui::Combo("ComputeShader", &mComputeProcess->mPipelineIndex, &mShaderNames[0], 3, 3))
	{
		// LOGI(L"Select ComputeShader %d", mItemIndex);
	}

	ImGui::End();
}
